package restPROC;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import utilClasses.uMapa;
import dao.daoAndrVoz;
import dao.daoKonekcija;

@Path("/Avozilo") 
public class VoziloAndr {
	@GET
	@Path("/Atest")
	@Produces("text/plain")
	public String testiraj(@QueryParam("lat") String lat,@QueryParam("long") String lang,@QueryParam("id") String id)
	{
		System.out.println("Vozilo: " + id +" (" + lat + ","+lang+")" );
		try {
			
			daoAndrVoz.noveKoord(lat, lang, id);
			
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return "TO";
	}
	@GET
	@Path("/AKoo")
	@Produces({"application/xml"})
	public uMapa koje(@QueryParam("id") String id)
	{
		
		try {
			
			uMapa m = daoAndrVoz.dajkoord(id);
			
			return m;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return new uMapa();
	}
}
